<?php
class ImageInfrastructureClient extends WebServiceClient {
	static function getKey() {
		$config = ConfigReaderFactory::getInstance()->getConfigReader(ImageInfrastructureClientConfig::WEB_SERVICE_CONFIG_FILE)->getConfig();
		return $config->webservice->key;
	}

	public function __construct() {
		$config = ConfigReaderFactory::getInstance()->getConfigReader(ImageInfrastructureClientConfig::WEB_SERVICE_CONFIG_FILE)->getConfig();
		$url = $config->webservice->url;
		$key = $config->webservice->key;
		parent::__construct($url, $key);
	}

	public function upload($id, $file) {
		return $this->invoke('ImageInfrastructure::Upload', array('id' => $id), array('file' => $file));
	}
	
	public function __call($name, $arguments) {
		return $this->invoke("ImageInfrastructure::{$name}", $arguments);
	}
}
?>
